﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pointsExchange.aspx.cs" Inherits="WebApp.admin.goods.pointsExchange" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>
        <%Response.Write(GetTitle()); %>
    </title>
    <link href="../css/skin.css" rel="stylesheet" type="text/css" />
</head>

<script type="text/javascript" src="../js/main.js"></script>

<script type="text/javascript" src="../js/jquery.min.js"></script>

<script type="text/javascript" src="../js/jquery.js"></script>

<script type="text/javascript">
    $(function () {
        $("#btnSubmit").click(function () {
            if ($("#txtName").val() == "") {
                alert("请输入商品名称！");
                $("#txtName").focus();
                return false;
            }
            if (location.search == "?ot=ad") {
                if ($("#filePointsFor").val() == "") {
                    alert("请选择商品图片！");
                    $("#filePointsFor").focus();
                    return false;
                }
                if ($("#filePointsFor").val() != "") {
                    //检测类型
                    var val = $("#filePointsFor").val().toLowerCase();
                    if (/^.*?\.(jpg|jpeg|gif|png|bmp)$/.test(val)) {
                    } else {
                        alert("商品图片只能上传,jpg,gif,png,bmp格式的图片");
                        $("#filePointsFor").select();
                        return false;
                    }
                }
            }
            else {
                if ($("#filePointsFor").val() != "") {
                    //检测类型
                    var val = $("#filePointsFor").val().toLowerCase();
                    if (/^.*?\.(jpg|jpeg|gif|png|bmp)$/.test(val)) {
                    } else {
                        alert("商品图片只能上传,jpg,gif,png,bmp格式的图片");
                        ("#filePointsFor").select();
                        return false;
                    }
                }
            }
            if ($("#txtExchangePoints").val() == "") {
                alert("请输入兑换积分！");
                $("#txtExchangePoints").focus();
                return false;
            }
            return true;
        });
    });
</script>

<body class="body">
    <table class="main" cellpadding="0" cellspacing="0">

        <tr>

            <td class="td_middle_middle">
                <div class="maincontent">
        <div  class="navgater"><img src="../images/module.gif" width="20" height="22" alt=""/>
所在位置：积分兑换列表->
<%= Request.QueryString["ot"] == "ed" ? "积分兑换商品编辑" : "积分兑换商品添加"%>

<a style=" display:block; float:right;" href="javascript:location.href=document.referrer;" ><img src="../images/history.gif" border="0" /></a>
</div>
                    <form id="formMain" runat="server">
                        <table cellpadding="0" cellspacing="0" style="width: 100%">
                            <tr>
                                <td class="td_title">
                                    商品名称：</td>
                                <td class="td_content">
                                    <input id="txtName" type="text" runat="server" maxlength="50" />*最多50个字符</td>
                            </tr>
                            <tr>
                                <td class="td_title">
                                    是否赠品：</td>
                                <td class="td_content">
                                    <input id="rdIfGift1" name="ifGift" type="radio" runat="server" value="1" />是&nbsp;&nbsp;<input
                                        id="rdIfGift0" name="ifGift" type="radio" runat="server" value="0" />否</td>
                            </tr>
                            <tr>
                                <td class="td_title">
                                    商品图片：</td>
                                <td class="td_content">
                                    <img alt="" id="imgPointsFor" src="" runat="server" />
                                    <input id="filePointsFor" runat="server" type="file" /><span class="imgClass"> *图片大小：240x182 分辨率:72像素 格式：gif, png</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_title">
                                    兑换积分：</td>
                                <td class="td_content">
                                    <input id="txtExchangePoints" type="text" runat="server" value="0" onpaste="return false" style="ime-mode:disabled"
                                        onkeypress="if ((event.keyCode<48 || event.keyCode>57||event.keyCode==46)) event.returnValue=false" />*</td>
                            </tr>
                            <tr>
                                <td class="td_title">
                                    描  述：</td>
                                <td class="td_content">
                                    <FCKeditorV2:FCKeditor ID="fckDescript" runat="server" BasePath="/fckeditor/"
                                        Height="400px">
                                    </FCKeditorV2:FCKeditor></td>
                            </tr>
                            
                            <tr>
                                <td colspan="2">
                                    <asp:Button ID="btnSubmit" runat="server" Text="确  定" CssClass="formButton" OnClick="btnSubmit_Click" />&nbsp;&nbsp;&nbsp;&nbsp;
                                   <input id="btnBack" type="button" class="formButton" value=" 返  回 " onclick="javascript:location.href=document.referrer;"  /></td>
                            </tr>
                        </table>
                    </form>
                </div>
            </td>
     
        </tr>

    </table>
</body>
</html>
